﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace CourierManager
{
    public class Van : TransportUnit
    {
        //we assume that the van has a maximum capacity of 1000
        public Van(string licensePlate, TransportUnitState state=TransportUnitState.Available) 
            : base(licensePlate, 1000,state)
        {
            
        }

        public Van(string brand, string licensePlate, int capacity)
            : base(brand, licensePlate, capacity)
        {

        }

        public override void SaveVehicleData()
        {
            string path = "../../../CourierManager/AllVehicles.txt";
            StreamWriter writer = new StreamWriter(path, true);
            using (writer)
            {
                string currentVan = String.Format("{0}*{1}*{2}*{3}*{4}*{5}", this.GetType().Name, this.Brand, this.LicensePlate,
                    this.Capacity, this.FuelConsumption, this.ProductionDate);
                writer.WriteLine(currentVan);
            }
        }
    }
}
